<template>
  <h2>生命周期钩子</h2>
</template>
<script>
export default {
  data() {
    return { count: 1}
  },
  beforeCreate() {
    console.log('beforeCreate()');
  },
  created() {
    // `this` 指向 vm 实例
    console.log('created(): ' + this.count); // => "count is: 1"
  },
  beforeMount() {
    console.log('beforeMount()');
  },
  mounted() {
    console.log('mounted()');
  },
  beforeUpdate() {
    console.log('mounted()');
  },
  updated() {
    console.log('updated()');
  },
  beforeUnmount() {
    console.log('beforeUnmount()');
  },
  unmounted() {
    console.log('unmounted()');
  }
}
</script>